function openSuperviseClass(id) {
    var width = '';
    var height = '';
    if ($.common.isMobile()) {
        width = 'auto';
        height = 'auto';
    }
    if ($.common.isEmpty(width)) {
        width = 800;
    }
    if ($.common.isEmpty(height)) {
        height = ($(window).height() - 50);
    }
    layer.open({
        type: 2,
        area: [width + 'px', height + 'px'],
        fix: false,
        //不固定
        maxmin: true,
        shade: 0.3,
        title: '促课',
        content: getRootPath_web() + '/student/student/getSuperviseInfo/' + id,
        btn: ['确定', '关闭'],
        // 弹层外区域关闭
        shadeClose: true,
        yes: function (data) {
            window.location.reload();
        },
        cancel: function (index) {
            window.location.reload();
        }
    });
}


function superviseClassClick() {
    var pro = document.getElementById("promotion").value;
    var id = document.getElementById("stuid").value;
    $.post(
        "/student/student/superviseClass",
        {stuid: id, promotion: pro},
        function (data) {
            if (data == 'success') {
                alert("促课成功")
                window.location.reload();
            }
        },
        "text"
    );

}

function getRootPath_web() {
    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
    var curWwwPath = window.document.location.href;
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName = window.document.location.pathname;
    var pos = curWwwPath.indexOf(pathName);
    //获取主机地址，如： http://localhost:8083
    var localhostPaht = curWwwPath.substring(0, pos);
    return (localhostPaht);
}